package stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * stream 原理分析
 *
 * @author
 */
public class Test {
    public static void main(String[] args) {

        List<Domain> list = new ArrayList<>();

        Domain info = new Domain();
        info.setId("123");
        info.setName("塑料袋副科级");

        Domain info1 = new Domain();
        info1.setId("123");
        info1.setName("sdfg");

        list.add(info);
        list.add(info1);

        List<Domain> list1 = list.stream().distinct().collect(Collectors.toList());
        System.out.println(list1);
    }
}
